It is common for computers to include one or more general-purpose input/output devices (“GPIOs”) that are accessible at input/output (“i/o”) addresses. For example, a desktop computer might use a GPIO to indicate whether the enclosure of the host is physically locked or unlocked. A laptop computer might use a GPIO to indicate whether the lid of the laptop has been closed. Another GPIO might be used to enable the flashing of a BIOS memory chip or to enable one of the power planes in a printed circuit board.
GPIOs are configurable. Configuring a GPIO entails writing a configuration value to a register. Depending on the particular configuration value written, various operating characteristics of the GPIO can be determined. The GPIO can be made to operate as an input or an output, its assertion level can be set to normal or inverted, its hardware interface can be selected as open-drain or push-pull, and so on.
If a GPIO is configured to behave as an output, then the state of its output may be controlled by writing an output data value to the GPIO after the device has been configured. BIOS routines are usually responsible for configuring the GPIOs on a host platform soon after power to the host is turned on or a reset is invoked. For those GPIOs configured as outputs, the BIOS initializes the states of the outputs.